package edu.mercer.sse.bkp;

/**
 * Log Exceptions, Throwables.<p>
 * 
 * Log Custom Exception: 
 * 
 * <ul>
 * <li>BackupException
 * <li>BackupSettingsException 
 * <li>BackupUncheckedException
 * </ul>
 * 
 * Log Throwable:
 * 
 * <ul>
 * <li>Generic method
 * </ul>
 * 
 * Visitor Pattern:<br> 
 * 
 * Interface for visitor which accepts any exception or throwable and 
 * 	performs logging operations.<p>
 * 
 * Note non-generic visit methods for suggested usage:<p>
 * 
 *  <code>Boolean visit( BackupException err );</code><p>
 * 
 * True if application log level setting permits logging of the exception.<p>
 * 
 * @param <C> - Result returned from logging visit
 * @param <E> - Throwable
 * 
 * @see BackupException
 * @see BackupSettingsException
 * @see BackupUncheckedException
 */

public interface BackupErrorLogging<C extends Object,
									E extends Throwable> 
{
	/**
	 * Log BackupException.<p>
	 * 
	 * @param err - BackupException
	 * 
	 * @return  Boolean - true if application log level permits logging this
	 * 	exception
	 * 
	 * @see BackupException
	 */
	
	Boolean visit( BackupException err );

	
	/**
	 * Log BackupSettingsException.<p>
	 * 
	 * @param err - BackupSettingsException
	 * 
	 * @return  Boolean - true if application log level permits logging this
	 * 	exception
	 * 
	 * @see BackupSettingsException
	 */
	
	Boolean visit( BackupSettingsException err );

	
	/**
	 * Log BackupUncheckedException.<p>
	 * 
	 * @param err - BackupUncheckedException
	 * 
	 * @return  Boolean - true if application log level permits logging this
	 * 	exception
	 * 
	 * @see BackupUncheckedException
	 */
	
	Boolean visit( BackupUncheckedException err );

	
	/**
	 * Log Throwable.<p>
	 * 
	 * Generic supporting any exceptions, errors as Throwable. Returns 
	 * 	generic of any object. Suggested usage: result of logging 
	 * 	operation.<p>
	 * 
	 * @param err - Throwable
	 * 
	 * @return  Generic bound to Object, result of the logging operation
	 */
	
	C visit( E err );

	
}//interface
